\documentclass{standalone}  
\usepackage{tikz}  
\usepackage{pgfplots}  

% 启用外部化  
\usetikzlibrary{external}  
\tikzexternalize  

\begin{document}  
	\begin{tikzpicture}  
		\begin{axis}[  
			title = {$f(x)=\frac{1}{1+25x^2}$},  
			xlabel = $x$,  
			ylabel = {$y$},  
			legend pos=north east,  
			legend style={at={(1,1)}, font=\small},
			]  
			\addplot[green, mark=none] table {6knots_second.txt};  
			\addlegendentry{$N=6$}  
			\addplot[blue, mark=none] table {11knots_second.txt};  
			\addlegendentry{$N=11$} 
			\addplot[orange, mark=none] table {21knots_second.txt};  
			\addlegendentry{$N=21$} 
			\addplot[red, mark=none] table {41knots_second.txt};  
			\addlegendentry{$N=41$} 
			\addplot[yellow, mark=none] table {81knots_second.txt};  
			\addlegendentry{$N=81$}
			\addplot[black, mark=none] table {f.txt};  
			\addlegendentry{$f(x)$} 
		\end{axis}  
	\end{tikzpicture}  
\end{document}  